/**
 * 
 */
package com.efast.cafe.util.jxl;

import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.Colour;
import jxl.format.VerticalAlignment;
import jxl.write.Alignment;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WriteException;

import org.springframework.stereotype.Component;

/**
 * @author Wangjianglin
 * FUNCTION : 类的主要功能描述
 *======================================================
 * CHANGE HISTORY
 *
 * YYMMDD    WHO       Description
 * -----------------------------------------------------
 * 2012-12-10   Name     	首次创建
 *======================================================
 */
@Component 
public class DefaultTitleFormat implements ITitleFormat{  
  
    public WritableCellFormat getTitleCellFormat() {  
        // TODO Auto-generated method stub  
        WritableCellFormat wcf = null;     
           try {     
               //字体样式     
               WritableFont wf = new WritableFont(WritableFont.TIMES,20, WritableFont.BOLD,true);//最后一个为是否italic     
               wf.setColour(Colour.RED);     
               wcf = new WritableCellFormat(wf);     
               //对齐方式     
               wcf.setAlignment(Alignment.CENTRE);     
               wcf.setVerticalAlignment(VerticalAlignment.CENTRE);     
               //边框     
               wcf.setBorder(Border.ALL,BorderLineStyle.THIN);     
                    
               //背景色     
               wcf.setBackground(Colour.GREY_25_PERCENT);     
           } catch (WriteException e) {     
            e.printStackTrace();     
           }     
           return wcf;      
    }  
  
}  
